<?php

namespace App\Providers;

use App\Contract\WorkerService;
use App\Shop;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
{
    
    // could instance a Worker like a service
    public $singletons = [
        'Worker' => WorkerService::class
    ];
    
    // binding a interface to a concrete service
    public $bindings = [
        'App\Contract\WorkerContract' => WorkerService::class
    ];
    
    /**
     * Register any application services.
     *
     * @return void
     */
    public function register()
    {
        app()->bind('Shop', function() {
            return new Shop();
        });
    
//        app()->singleton('Worker', function() {
////            return new WorkerService();
////        });
    }

    /**
     * Bootstrap any application services.
     *
     * @return void
     */
    public function boot()
    {
        schema::defaultStringLength(191);
    }
}
